var vm = new Vue({
	el : '#rrapp',
	data : {
		dataPayroll : [],
		sum:""
	},
	created: function() {
		var workNo = GetRequest(location.search)["workNo"];
		$.get("../datapayroll/talent/"+workNo, function(r){
				vm.dataPayroll = r.dataPayroll;
				vm.sum = r.sum;
				initGrid(vm.dataPayroll);
			});
		
	}
});

function initGrid(data) {
	$("#jqGrid").jqGrid({
		datatype : 'local',
		data: data || [],
		colModel : [{
			label: '姓名',
			name : "name",
			index : "name",
			align : 'center',
			width : '50'
		}, {
			label: '工号',
			name : "workNo",
			index : "workNo",
			align : 'center',
			width : '100'
		}, {
			label: '岗位编号',
			name : "jobno",
			index : "jobno",
			width : '100'
		}, {
			label: '首月底薪',
			name : "firstmonthwage",
			index : "firstmonthwage",
			width : '100'
		},{
			label: '底薪',
			name : "monthwage",
			index : "monthwage",
			align : 'center',
			width : '100'
		}, {
			label: '提成',
			name : "businesspromotion",
			index : "businesspromotion",
			align : 'center',
			width : '100'
		},{
			label: '发薪月',
			name : "payrollmonth",
			index : "payrollmonth",
			align : 'center',
			width : '100'
		}],
		rowNum: data.length,
		multiselect : false,
		height: 385,
		gridComplete : function() {
			// 隐藏grid底部滚动条
			$(this).closest(".ui-jqgrid-bdiv").css({
				"overflow-x" : "hidden"
			});
			$(this).jqGrid("setGridWidth", vm.$el.offsetWidth * 1, true);
			$(this).jqGrid("setLabel", 'rn', '序号', {'text-align': 'center'});
		},
		rownumbers: true,
		rownumWidth: 40,
	});
}
